﻿using llm_net.Services.Abstractions;
using llm_net.Services.Implementations;
using llm_project.Services.Implementations;

namespace llm_net.Infrastructure.Extensions
{
    public static class ServiceCollectionExtensions
    {
        public static IServiceCollection AddRecommendationServices(this IServiceCollection services, IConfiguration configuration)
        {
            services.AddHttpClient();
            services.AddScoped<IUserTagService, UserTagService>();
            services.AddScoped<ITongyiApiService, TongyiApiService>();
            services.AddScoped<IVectorDbService, VectorDbService>();
            services.AddScoped<IRecommendationService, RecommendationService>();
            services.AddScoped<LlmApiClient>();
            services.Configure<TongyiApiOptions>(configuration.GetSection("TongyiApi"));
            return services;
        }

        public class TongyiApiOptions
        {
            public string Endpoint { get; set; }
            public string AppKey { get; set; }
        }
    }
}
